<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<?php 
	//include_once('../DAO/TaiKhoanDTO.php');
	include_once('../DAO/TaiKhoanDAO.php');
	//require("../DAO/DataHelper.php");
	require("../webconfig.php");
	?>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Thông tin shop</title>
		<link rel="stylesheet" href="../css/reset.css" type="text/css" />
		<link rel="stylesheet" href="../css/common.css" type="text/css" />
		<link rel="stylesheet" href="../css/seller.css" type="text/css" />
		<script src="../scripts/jquery-1.5.2.min.js"></script>
		<script src="../scripts/common.js"></script>
		<script type="text/javascript" src="quanlytaikhoan.js"></script>
		<link rel="stylesheet" href="../css/MenuMatic.css" type="text/css" media="screen" charset="utf-8" />
		<link rel="stylesheet" href="../css/MenuMatic2.css" type="text/css" media="screen" charset="utf-8" />
	</head>
	<body>
		<div id="page">
			<?php
				
				include_once("../UserControl/header.php");
			?>

			<div id="content">
				<div id="shop-banner">
					<img src="../temp/shop-banner.jpg" />
				</div>
				<?php
					require("../UserControl_NguoiBan/MenuDanhMucChucNang.php");
				?>
				<div id="seller-shop-info" class="block layout-2col-col2">
					<div class="title">
					  <h3>Quản Lý Tài Khoản </h3>
				  </div>
					<div class="content" id="content">
						 <table>
						 <tr>
						 <td align="center">
						 <select name='select' id="select" onchange="HienThiTaiKhoan(this.value)" style='width:250px' >
                           <option value ='0'>Tài Khoản Người Bán</option>
                           <option value ='1'>Tài Khoản Người Mua</option>
                         </select></td>
						   </tr>
				  </table>
				  <div><br/></div>
				  <div id="HienThi">
						<table style="width: 666px;" id="gradient-style" summary="Meeting Results">

                            <thead>
                                <tr>
                                <th style="width: 250px;" scope="col">Tên Tài Khoản </th>
								<th style="width: 200px;" scope="col">Tên Đăng Nhập </th>
                                <th width="70" scope="col">Trạng Thái </th>
								<th width="210" scope="col"></th>
                                </tr>
                            </thead>
                            <tfoot>
                                <tr>
                                <td colspan="9">Give background color to the table cells to achieve seamless transition</td>
                                </tr>
                            </tfoot>
 
                            <tbody id="tbody">
<?php
$result = TaiKhoanDAO::DanhSachTaiKhoanNguoiBan();
for($i = 0 ; $i < count($result) ; $i++)
{
	$row = $result[$i];
	$temp = $row->tk_username;
?>
	<tr>
		<td style="background: #d1d1d1;"><?php echo $row->tk_ho_ten ?></td>
		<td style="background: #d1d1d1;"><label id="label<?php echo $i;?>"><?php echo("$row->tk_username") ?></label></td>
		<td style="background: #d1d1d1;">
		<select name='<?php echo $i ?>' id="<?php echo $i ?>" onchange="CapNhatTrangThai(this.value,<?php echo $i ?>)" >
			<?php
			if($row->tk_tinh_trang == 0)
			{
				echo"<option value ='0'>Đang khóa</option> ";
				echo"<option value ='1'>Đang sử dụng</option>";
			}
			else
			{
				echo"<option value ='1'>Đang sử dụng</option> ";
				echo"<option value ='0'>Đang khóa</option> ";
			}
			?>
		</select>
		</td>
		<td style='background: #d1d1d1;'><a style='cursor:pointer; color: purple;'  title='Xoa' onClick='XoaMotUser(<?php echo $i ?>);' />Xóa Tài Khoản</a></td>
	</tr>
<?php
}
?>  
                            </tbody>
                      </table> 
 						</div>
					</div>
				</div>
			</div>
			<?php
				require("../UserControl/footer.php");
			?>
		</div>
	</body>
</html>